<?php if (empty($this->collection) || !$this->collection->count()) : ?>
	<?php return; ?>
<?php endif; ?>

<?php $category = null; ?>


<div class = "docs">

<?php foreach ($this->collection as $entry) : ?>
	<?php if ($category != $entry->category) : ?>
		<?php if (!empty($category)) : ?>

	</dl>

		<?php endif; ?>

		<?php $category = $entry->category; ?>

<h4><?php echo $category; ?></h4>
<dl>

	<?php endif; ?>

	<dt><a href = "/upload/<?php echo $entry->file; ?>"><?php echo $entry->title; ?></a></dt>
	<dd><?php echo $entry->announce?></dd>

<?php endforeach; ?>

</dl>

</div>